/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MainPanel.java
 *
 * Created on 2010-10-1, 20:06:46
 */

package finalsoft;

import java.awt.Graphics;
import java.awt.image.BufferedImage;

/**
 *
 * @author lq
 */
public class Main extends javax.swing.JPanel {
    private BufferedImage image;

    /** Creates new form MainPanel */
    public Main() {
        initComponents();
    }  
    public  Main(BufferedImage image)
    {
       this.image   =  image;
        initComponents();
    }
    @Override
    protected   void   paintComponent(Graphics   g)   {
    g.drawImage(image,   0,   0,   this.getWidth(),   this.getHeight(),   this);
     }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setName("Form"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 791, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 432, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables

}
